package util

import (
	"gitee.com/kristas/booting-go/framework/common/util/lang"
	"reflect"
)

func GetBeanStructName(bean interface{}) string {
	sType := reflect.TypeOf(bean).String()
	beanName := lang.NewString(sType).SubStringFrom(lang.NewString(sType).LastIndexOf(".") + 1).RemoveSuffix("Impl")
	return beanName.String()
}

func GetBeanFileName(bean interface{}) string {
	return lang.NewString(GetBeanStructName(bean)).SnakeCase().Concat(".go").String()
}
